package com.test10;

import org.junit.Test;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

public class MyTest_03 {

    @Test
    public void test1() {
        Function<Double, Long> function = Math :: round;
        System.out.println(function.apply(-16.8));
    }

    @Test
    public void test2() {
        Consumer<String> consumer = System.out :: println;
        consumer.accept("Hello World");
    }

    @Test
    public void test3() {
        Supplier<Double> supplier = Math :: random;
        System.out.println(supplier.get());
    }

    @Test
    public void test4() {
        String str = "baidu";
        Predicate<String> predicate = str :: equalsIgnoreCase;
        System.out.println(predicate.test("BAIDU"));
    }
}
